package com.le.dub.service.impl;

import com.le.dub.common.cosyvoice.GuoleCosyVoiceDemo;
import com.le.dub.service.IVoiceService;
import com.le.dub.service.IFileService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 腾讯服务实现
 * @author guole
 * @created 2024/10/5
 */
@ConditionalOnProperty(name = "voiceService",havingValue = "tencent")
@Service
public class TencentVoiceServiceImpl implements IVoiceService {
    @Resource
    private IFileService fileService;

    @Override
    public byte[] textToSpeech(String text,String cosyVoiceName) {
         GuoleCosyVoiceDemo guoleCosyVoiceDemo=new GuoleCosyVoiceDemo();
        byte[] result= guoleCosyVoiceDemo.textToSpeech(text,cosyVoiceName);
        return  result;
    }

    @Override
    public String cloneVoice(String voiceName, String fileUrl) {
        return "我是腾讯";
    }
}
